﻿'Partial Public Class _Default
'    Inherits System.Web.UI.Page
'    Implements card



'    Private CardPresenter As New CardPresenter()

'    Private _card As QuizEntities.QuizCard
'    Public Property Card() As QuizEntities.QuizCard
'        Get
'            Return _card
'        End Get
'        Set(ByVal value As QuizEntities.QuizCard)
'            _card = value
'        End Set
'    End Property


'    Private _quiz_Id As String
'    Public ReadOnly Property Quiz_Id() As String
'        Get
'            _quiz_Id = quizId.Value
'            Return _quiz_Id
'        End Get
'    End Property

'    Private _selectedAnswer As Integer
'    Public ReadOnly Property SelectedAnswer() As Integer
'        Get
'            _selectedAnswer = RBLQuestionCard.SelectedIndex
'            _selectedAnswer = _selectedAnswer + 1
'            Return _selectedAnswer
'        End Get
'    End Property


'    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'        If IsPostBack Then

'        Else

'            Card = CardPresenter.GetFirstCard(PreviousPage.QuizId)
'            ShowQuestionCard(Card)
'        End If
'    End Sub




'    Public Sub ShowQuestionCard(ByVal quizCard As QuizEntities.QuizCard) Implements Card.ShowQuestionCard
'        lblQuestion.Text = quizCard.QusestionCard.Ques
'        RBLQuestionCard.Items.Clear()
'        RBLQuestionCard.Items.Add(quizCard.QusestionCard.OptionOne)
'        RBLQuestionCard.Items.Add(quizCard.QusestionCard.OptionTwo)
'        RBLQuestionCard.Items.Add(quizCard.QusestionCard.OptionThree)
'        RBLQuestionCard.Items.Add(quizCard.QusestionCard.OptionFour)
'        quizId.Value = quizCard.QuizUniqueId
'        Check.Value = quizCard.QusestionCard.CorrectAnswer
'        lblCurrentCardNo.Text = quizCard.Status.CurrentQuestion
'        lblIsAnswered.Text = quizCard.Status.IsAnswered
'        lblIsCorrectAnswered.Text = quizCard.Status.IsCorrectAnswered
'        lblScore.Text = quizCard.Status.Score

'    End Sub

'    Private Sub ValidateAnswer(ByVal card As QuizEntities.QuizCard)
'        If Check.Value = SelectedAnswer Then
'            lblIsAnswered.Text = True
'            lblIsCorrectAnswered.Text = True
'            lblScore.Text = (CInt(lblScore.Text) + 1)
'        Else
'            lblIsAnswered.Text = True
'        End If
'    End Sub

'    Public Sub ShowResults(ByVal quizCard As QuizEntities.QuizCard) Implements Card.ShowResults
'        Response.Write("<h3>Thank You</h3>")
'    End Sub

'    Protected Sub RBLQuestionCard_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles RBLQuestionCard.SelectedIndexChanged
'        RBLQuestionCard.Enabled = False
'        FillQuizCardDetailsFromPage()
'        ValidateAnswer(Card)
'    End Sub

'    Sub FillQuizCardDetailsFromPage()
'        Card = New QuizEntities.QuizCard()
'        Card.Status.CurrentQuestion = lblCurrentCardNo.Text
'        Card.Status.IsAnswered = lblIsAnswered.Text
'        Card.Status.IsCorrectAnswered = lblIsCorrectAnswered.Text
'        Card.Status.Score = lblScore.Text
'        Card.QuizUniqueId = quizId.Value

'    End Sub


'    Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNext.Click
'        FillQuizCardDetailsFromPage()
'        RBLQuestionCard.Enabled = True
'        CardPresenter.Submit_Handler(Me)
'    End Sub

'    'Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
'    '    'RBLQuestionCard.Enabled = False
'    '    'FillQuizCardDetailsFromPage()
'    '    'ValidateAnswer(Card)
'    'End Sub
'End Class